import java.util.Random;
import java.util.Scanner;

public class test {
   /* public static void main(String[] args) {
        int a = 1 ;
        while ( a <= 100){

           if ( a % 15 ==0 ){
               System.out.println(a);
               a++;
               continue;
           }
            a++;*//*
        }


    }*/
  /*  //猜数字游戏
   public static void main(String[] args) {
       Random random = new Random();
       int rannum = random.nextInt(101);
       Scanner scanner = new Scanner(System.in);
       while(true){
           System.out.println("输入猜测的数字");
           int scnum = scanner.nextInt();
           if(scnum>rannum){
               System.out.println("猜大了");
           }
           else if (scnum == rannum){
               System.out.println("猜到了");
               break;
           }else{
               System.out.println("猜小了");}

       }


   }*/

   /* public static void main(String[] args) {
        //编写程序数一下 1到 100 的所有整数中出现多少个数字9
        int con = 0 ;
        for (int i = 1; i <=100 ; i++) {
            if (i % 10 ==9) {
                con++;
            }
            if (i / 10 == 9) {
                con++;
            }
        }
        System.out.println(con);
    }*/
    //给定一个数字，判定一个数字的范围里什么是素数
   public static void main(String[] args) {
     Scanner scanner = new Scanner(System.in);
     System.out.println("输入一个数字，判定其范围内的素数");
     int num = scanner.nextInt();
       for (int k = 1; k <= num; k++) {
           int i = 2 ;
           for (; i < Math.sqrt(k); i++) {
                if (k % i==0){
                    break;
                }

           }
           if (i >Math.sqrt(k)) {
               System.out.println(k+"是素数");

           }

       }
   }
    //给定两个数，求这两个数的最大公约数
    //
    //例如：
    //
    //输入：20 40
    //
    //输出：20
  /* public static void main(String[] args) {
       Scanner scanner = new Scanner(System.in);
       System.out.println("请输入第一个数字:");
       int a = scanner.nextInt();
       System.out.println("请输入第二个数字:");
       int b = scanner.nextInt();
       int c = a % b ;
       while (c != 0){
           a = b ;
           b = c ;
           c = a%b;
       }
       System.out.println(b);
   }*/
}
